package i_thread;

// ThreadEx2
// make : pwg
// date : 2003
// note : 별도의 class에 쓰레드를 구현하여 실행
// =======================================

// 쓰레드 class
class  ThreadEx2_sub extends Thread
{
	String str;
	int i, sum=0;

	public ThreadEx2_sub(String s)
	{
		str = s;
	}

	public void run()
	{
		for(i=1 ; i<11 ; i++)
		{
			sum += i;
			System.out.println(str + sum);
			yield();
		}
	}

}

public class ThreadEx2 
{
	public static void main(String args[])
	{
		ThreadEx2_sub t1 = new ThreadEx2_sub("t1=");
		ThreadEx2_sub t2 = new ThreadEx2_sub("t2=");

		t1.start();
		t2.start();

	}
};

